package com.pingao.mp.modular.sys.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

@Data
@TableName(value = "sys_user_roles")
public class UserRoles extends Model<UserRoles> {

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 角色ID
     */
    @TableField(value = "role_id")
    private Integer roleId;

    /**
     * 角色备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 添加时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 删除时间
     */
    @TableField(value = "delete_time")
    private LocalDateTime deleteTime;

    public static final String COL_ID = "id";

    public static final String COL_USER_ID = "user_id";

    public static final String COL_ROLE_ID = "role_id";

    public static final String COL_REMARK = "remark";

    public static final String COL_CREATE_TIME = "create_time";

    public static final String COL_DELETE_TIME = "delete_time";

    public static final String COL_ROLE_CODE = "role_code";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}